/*
 * @Descripttion: 
 * @version: 
 * @Author: spring
 * @Date: 2022-04-16 22:58:24
 * @LastEditors: spring
 * @LastEditTime: 2022-04-17 00:56:05
 */
export default function combineReducers(reducers: any) {
  return function (state: any = {}, action: any) {
    const newState: any = {};
    Object.keys(reducers).forEach(key => {
      const childState = state[key];
      newState[key] = reducers[key](childState, action);
    });
    return newState
  }
}
